Public Class NAlumnos
    Public Function buscarAlumnoPorApellido(ByVal oAlumno As Entidades.EAlumno, ByVal cond As Boolean) As List(Of Entidades.EAlumno)
        'utiliza la capa de datos para esta operacion
        Dim oDatos As New Datos.DAlumnos()
        Dim oAlumnosNeg As New List(Of Entidades.EAlumno)
        Try
            oAlumnosNeg = oDatos.buscarAlumno(oAlumno.apellido, cond)
        Catch ex As Exception
            Throw New ArgumentException(ex.Message)
        Finally
            oDatos = Nothing
        End Try
        Return oAlumnosNeg
    End Function

    Public Function buscarAlumnoPorLegajo(ByVal oAlumno As Entidades.EAlumno)
        'utiliza la capa de datos para esta operacion
        Dim oDatos As New Datos.DAlumnos()
        'Dim oAlumnosNeg As New List(Of Entidades.EAlumno)
        Dim Alumno As New Entidades.EAlumno
        Try
            'oAlumnosNeg = oDatos.buscarAlumno(oAlumno.Num_Legajo)
            Alumno = oDatos.buscarAlumno(oAlumno.Num_Legajo)
        Catch ex As Exception
            Throw New ArgumentException(ex.Message)
        Finally
            oDatos = Nothing
        End Try
        Return Alumno
    End Function

    Public Function modificarAlumno(ByVal oAlumno As Entidades.EAlumno) As Boolean
        'utiliza la capa de fdatos para esta operacion
        Dim oDatos As New Datos.DAlumnos()
        Dim band As Boolean = False
        Try
            oDatos.modificarAlumno(oAlumno)
            band = True
        Catch ex As Exception
            Throw New ArgumentException(ex.Message)
        Finally
            oDatos = Nothing
        End Try
        Return band
    End Function

    Public Function borrarAlumno(ByVal oAlumno As Entidades.EAlumno) As Boolean
        Dim oDatos As New Datos.DAlumnos()
        Dim band As Boolean = False
        Try
            oDatos.borrarAlumno(oAlumno)
            band = True
        Catch ex As Exception
            Throw New ArgumentException(ex.Message)
        End Try
        Return band
    End Function

    'SOBRECARGADO: Devuelve una lista de alumnos de acuerdo a la condicion (activo o inactivo)
    Public Function buscarAlumnos(ByVal cond As Boolean) As List(Of Entidades.EAlumno)
        Dim oDatos As New Datos.DAlumnos()
        Try
            Return oDatos.buscarAlumnos(cond)
        Catch ex As Exception
            Throw New ArgumentException(ex.Message)
        Finally
            oDatos = Nothing
        End Try
    End Function

    'SOBRECARGADO: Devuelve una lista de todos alumnos, tanto activos como inactivos
    Public Function buscarAlumnos() As List(Of Entidades.EAlumno)
        Dim oDatos As New Datos.DAlumnos()
        Try
            Return oDatos.buscarAlumnos()
        Catch ex As Exception
            Throw New ArgumentException(ex.Message)
        Finally
            oDatos = Nothing
        End Try
    End Function

    Public Function buscarAlumnoNuevos() As List(Of Entidades.EAlumno)
        'utiliza la capa de datos para esta operacion
        Dim oDatos As New Datos.DAlumnos()
        Dim oAlumnosNeg As New List(Of Entidades.EAlumno)
        Try
            Return oDatos.buscarAlumnosNuevos()
        Catch ex As Exception
            Throw New ArgumentException(ex.Message)
        Finally
            oDatos = Nothing
        End Try

    End Function
End Class
